package fr.afcepf.atod18.fw.controler;

import java.util.Map;

import fr.afcepf.atod18.fw.action.IAction;



public class Factory {


    public Factory() {
        
    }
    
    public IAction done(String provenance, Map params){
        
        Class<IAction> c = (Class<IAction>) params.get(provenance);
        IAction a = null;
        
        try{
            a = (IAction)c.newInstance();
        }
        catch (InstantiationException ie){
            ie.printStackTrace();
        }
        catch (IllegalAccessException e){
            e.printStackTrace();
        }
        
        return a; 
        
    }
 
}
